<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="mall/header::head-fragment('Magic_Coffee咖啡店-商品详情','detail')">
</head>
<body>
<header th:replace="mall/header::header-fragment"></header>
<nav th:replace="mall/header::header-search-fragment"></nav>
<div class="crumb">
    <div class="w">
        <div class="crumb-con">
            <a href="./index.html" class="link">Mall</a>
            <span>></span>
            <span class="link-text">商品详情</span>
        </div>
    </div>
</div>

<div class="page-wrap w">
    <div class="intro-wrap">
        <div class="p-img-con">
            <div class="main-img-con">
                <img class="main-img" th:src="@{ ${productDetail.imageHost}+${productDetail.mainImage} }" th:alt="${productDetail.name}"/>
            </div>
            <ul class="p-img-list">
                <th:block th:each="subImages : ${productDetail.subImages}">
                    <li class="p-img-item">
                        <img class="p-img" th:src="@{ ${productDetail.imageHost}+${subImages} }" th:alt="${productDetail.name}"/>
                    </li>
                </th:block>
            </ul>
        </div>

        <div class="p-info-con">
            <input class="productId" type="hidden" th:value="${productDetail.id}">
            <h1 class="p-name">[[ ${productDetail.name} ]]</h1>
            <p class="p-subtitle">[[ ${productDetail.subtitle} ]]</p>
            <div class="p-info-item p-price-con">
                <span class="label">价格：</span>
                <span class="info">￥[[ ${productDetail.price} ]]</span>
            </div>
            <div class="p-info-item p-stock-con">
                <span class="label">库存：</span>
                <span class="info" th:value="${productDetail.stock}">[[ ${productDetail.stock} ]]</span>
            </div>
            <div class="p-info-item p-count-con">
                <span class="label">数量：</span>
                <input class="p-count" value="1" readonly=""/>
                <span class="p-count-btn plus">+</span>
                <span class="p-count-btn minus">-</span>
            </div>
            <div class="p-info-item">
                <a class="btn cart-add">加入购物车</a>
            </div>
        </div>
    </div>
    <div class="detail-wrap">
        <div class="detail-tab-con">
            <ul class="tab-list">
                <a th:href="@{'./detail.html?productId=' + ${productDetail.id}}"><li class="tab-item active">详细描述</li></a>
                <a th:href="@{'./detail_comment.html?productId=' + ${productDetail.id}}"><li class="tab-item">客户评论</li></a>
            </ul>
        </div>
        <div class="detail-con" th:utext="${productDetail.detail}">
        </div>
    </div>
</div>

<script th:src="@{/admin/plugins/jquery/jquery-3.5.1.min.js}"></script>
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<script th:src="@{/mall/js/search.js}" type="text/javascript"></script>
<script th:src="@{/mall/js/detail.js}" type="text/javascript"></script>

</body>
</html>